<?php
$sondage_id=2;
  $sql="SELECT q.id as id_question,q.texte_$lang as question,c.id as id_choix,c.texte_".$lang." as choix ,q.type FROM sondage_questions as q, sondage_choix as c where c.id_question=q.id AND q.id=$sondage_id  order by c.id desc" ;
         #echo $sql."<br>";
         $result = mysql_query($sql, $dbi);
         #echo mysql_errno().": ".mysql_error()."<BR>";
               while($row=mysql_fetch_array($result,1)){
               #print_r($row);
                  $sondage["id"]=$row["id_question"];
                  $sondage["type"]=$row["type"];
                  $sondage["question"]=$row["question"];
                  $sondage["choix"][$n]["id"]=$row["id_choix"];
                  $sondage["choix"][$n++]["texte"]=$row["choix"];
               }
               if( $sondage["choix"]){
               #print_r($sondage);
              echo"

              <form name=\"sondage\" method=\"post\" action=\"./sondage.php\">
                          <table width=\"160\" cellspacing=\"0\" cellpadding=\"0\">
              <tr>
              <td>
              <input name=\"op\" type=\"hidden\" value=\"enregistrer_le_vote\">
              <input name=\"id_question\" type=\"hidden\" value=\"".$sondage["id"]."\">
              <input name=\"points\" type=\"hidden\" value=\"1\">
              <font class=\"bcontent\">".$sondage["question"]."</font><br>";
                          foreach($sondage["choix"] as $choix ){
                          echo "<font class=\"content\">".$choix["texte"]."</font>";
                                  if($sondage["type"]==5){
                                  note_etoiles($choix["id"]);
                                  }else{
                                  echo" <input type=\"radio\" name=\"id_choix\" value=\"id_choix".$choix["id"]."\">
                                  <input name=\"Note".$choix["id"]."\" type=\"hidden\" value=\"1\"> <br>";
                                  }
                          }
              echo"<a href=\"javascript:document.sondage.submit()\" target=\"_self\" ><font class=\"blcontent\">"._VOTER."</font></a>

                    </td></tr></table></form>";
               }

?>